﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace SubstrateHelper.Models
{
    public class ProductionEntity:SequenceBase
    {
        [Key]
        [Display(Name = "物料（材料及设备）名")]
        [Required(ErrorMessage = "物料（材料及设备）名不能为空！")]
        [StringLength(20, ErrorMessage = "最大长度=20！")]
        public string Name { get; set; }


        


        [Display(Name = "供应商")]
        //[Required(ErrorMessage = "供应商不能为空！")]
        [StringLength(50, ErrorMessage = "最大长度=50！")]
        public string Suppiler { get; set; }



        //[Display(Name = "规格类型")]
        //[Required(ErrorMessage = "规格类型不能为空！")]
        //[StringLength(50, ErrorMessage = "最大长度=50！")]
        //public string Type { get; set; }




        [Display(Name = "物料类型")]
        [Required(ErrorMessage = "不能为空！")]
        public ProductionEntityType ProductionEntityType { get; set; }

        public bool IsDiscarded { get; set; }

        [Display(Name = "数量单位")]        
        public string QuantityUnit { get; set; }


        public List<Inventory> Inventories { get; set; }
        public List<ProductionEntityCategory> ProductionEntityCategories { get; set; }
    }

    public enum ProductionEntityType
    {
        Material,//原材料
        Device,//设备
        NonLossAuxiliary,//非易损辅助材料或工具
        Fomula,//配方单
        Product//产出材料
    }
}
